package app;

import java.util.*;

public class Node {
	private AttributeValue branchValue;
	
	public Node(AttributeValue branchValue) {
		this.branchValue = branchValue;
	}

	public AttributeValue getBranchValue() {
		return this.branchValue;
	}
}

class BranchNode extends Node {
	private Attribute attribute;
	private List<Node> children;
	
	public BranchNode(Attribute attribute, AttributeValue branchValue) {
		super(branchValue);
		children = new ArrayList<Node>();
		this.attribute = attribute;
	}
	
	public void addChild(Node child) {
		children.add(child);
	}
	
	public Attribute getAttribute() {
		return attribute;
	}
	
	public List<Node> getChildren() {
		return children;
	}
}

class LeafNode extends Node {
	private SymbolicValue classValue;
	
	public LeafNode(SymbolicValue classValue, AttributeValue branchValue) {
		super(branchValue);
		this.classValue = classValue;
	}
	
	public SymbolicValue getClassValue() {
		return classValue;
	}
}